import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/emergency/barrage_list_entity.dart';

BarrageListEntity $BarrageListEntityFromJson(Map<String, dynamic> json) {
  final BarrageListEntity barrageListEntity = BarrageListEntity();
  final String? barrageContent = jsonConvert.convert<String>(json['barrageContent']);
  if (barrageContent != null) {
    barrageListEntity.barrageContent = barrageContent;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    barrageListEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    barrageListEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    barrageListEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    barrageListEntity.deleted = deleted;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    barrageListEntity.id = id;
  }
  final String? multiMedia = jsonConvert.convert<String>(json['multiMedia']);
  if (multiMedia != null) {
    barrageListEntity.multiMedia = multiMedia;
  }
  final String? position = jsonConvert.convert<String>(json['position']);
  if (position != null) {
    barrageListEntity.position = position;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    barrageListEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    barrageListEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    barrageListEntity.updateDate = updateDate;
  }
  return barrageListEntity;
}

Map<String, dynamic> $BarrageListEntityToJson(BarrageListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['barrageContent'] = entity.barrageContent;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['multiMedia'] = entity.multiMedia;
  data['position'] = entity.position;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension BarrageListEntityExtension on BarrageListEntity {
  BarrageListEntity copyWith({
    String? barrageContent,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? id,
    String? multiMedia,
    String? position,
    String? updateBy,
    String? updateById,
    String? updateDate,
  }) {
    return BarrageListEntity()
      ..barrageContent = barrageContent ?? this.barrageContent
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..multiMedia = multiMedia ?? this.multiMedia
      ..position = position ?? this.position
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate;
  }
}
